import ClaimType from '@/types/dtos/base/claim-type';
import axios from '../../plugins/axios';

let service = {
  // 分页
  async getPagedList(json: any): Promise<Array<ClaimType>> {
    return await axios.post('/api/ClaimType/GetPagedList', json);
  },
  // 新增
  async insert(claimType: ClaimType): Promise<any> {
    return await axios.post('/api/ClaimType/Insert', claimType);
  },
  // 更新
  async update(claimType: ClaimType): Promise<any> {
    return await axios.put('/api/ClaimType/Update', claimType);
  },
  // 删除
  async delete(json: any): Promise<any> {
    return await axios.delete('/api/ClaimType/Delete', { data: json });
  },
  // 查询列表
  async getList(json: any): Promise<Array<ClaimType>> {
    return await axios.post('/api/ClaimType/GetList', json);
  },
  // 查询单条记录
  async get(id: string): Promise<ClaimType> {
    return await axios.get('/api/ClaimType/Get/' + id);
  },
  // 查询所有记录
  async getAll(): Promise<Array<ClaimType>> {
    return await axios.get('/api/ClaimType/GetAll');
  }
}

export default service;